At present, the majority of standardized video coding algorithms are based on hybrid video coding. Hybrid video coding methods typically combine several different lossless and lossy compression schemes in order to achieve the desired compression gain. Hybrid video coding is also the basis for ITU-T standards (H.26x standards such as H.261, H.263) as well as ISO/IEC standards (MPEG-X standards such as MPEG-1, MPEG-2, and MPEG-4). The most recent and advanced video coding standard is currently the standard denoted as H.264/MPEG-4 advanced video coding (AVC) which is a result of standardization efforts by joint video team (JVT), a joint team of ITU-T and ISO/IEC MPEG groups. This codec is being further developed by Joint Collaborative Team on Video Coding (JCT-VC) under a name High-Efficiency Video Coding (HEVC), aiming, in particular at improvements of efficiency regarding the high-resolution video coding.
A video signal input to an encoder is a sequence of images called frames, each frame being a two-dimensional matrix of pixels. All the above-mentioned standards based on hybrid video coding include subdividing each individual video frame into smaller blocks consisting of a plurality of pixels. The size of the blocks may vary, for instance, in accordance with the content of the image. The way of coding may be typically varied on a per block basis. The largest possible size for such a block, for instance in HEVC, is 64×64 pixels. It is then called the largest coding unit (LCU). In H.264/MPEG-4 AVC, a macroblock (usually denoting a block of 16×16 pixels) was the basic image element, for which the encoding is performed, with a possibility to further divide it in smaller subblocks to which some of the coding/decoding steps were applied.
Typically, the encoding steps of a hybrid video coding include a spatial and/or a temporal prediction. Accordingly, each block to be encoded is first predicted using either the blocks in its spatial neighborhood or blocks from its temporal neighborhood, i.e. from previously encoded video frames. A block of differences between the block to be encoded and its prediction, also called block of prediction residuals, is then calculated. Another encoding step is a transformation of a block of residuals from the spatial (pixel) domain into a frequency domain. The transformation aims at reducing the correlation of the input block. Further encoding step is quantization of the transform coefficients. In this step the actual lossy (irreversible) compression takes place. Usually, the compressed transform coefficient values are further compacted (losslessly compressed) by means of an entropy coding. In addition, side information necessary for reconstruction of the encoded video signal is encoded and provided together with the encoded video signal. This is for example information about the spatial and/or temporal prediction, amount of quantization, etc.
FIG. 1 is an example of a state of the art hybrid coder 100, as for example a typical H.264/MPEG-4 AVC and/or HEVC video encoder. A subtractor 105 first determines differences e between a current block to be encoded of an input video image (input signal s) and a corresponding prediction block ŝ, which is used as a prediction of the current block to be encoded. The prediction signal may be obtained by a temporal or by a spatial prediction 180. The type of prediction can be varied on a per frame basis or on a per block basis. Blocks and/or frames predicted using temporal prediction are called “inter”-encoded and blocks and/or frames predicted using spatial prediction are called “intra”-encoded. Prediction signal using temporal prediction is derived from the previously encoded images, which are stored in a memory. The prediction signal using spatial prediction is derived from the values of boundary pixels in the neighboring blocks, which have been previously encoded, decoded, and stored in the memory. The difference e between the input signal and the prediction signal, denoted prediction error or residual, is transformed 110 resulting in coefficients, which are quantized 120. Entropy encoder 190 is then applied to the quantized coefficients in order to further reduce the amount of data to be stored and/or transmitted in a lossless way. This is mainly achieved by applying a code with code words of variable length wherein the length of a code word is chosen based on the probability of its occurrence.
Within the video encoder 100, a decoding unit is incorporated for obtaining a decoded (reconstructed) video signal s′. In compliance with the encoding steps, the decoding steps include dequantization and inverse transformation 130. The so obtained prediction error signal e′ differs from the original prediction error signal due to the quantization error, called also quantization noise. A reconstructed image signal s′ is then obtained by adding 140 the decoded prediction error signal e′ to the prediction signals. In order to maintain the compatibility between the encoder side and the decoder side, the prediction signals is obtained based on the encoded and subsequently decoded video signal which is known at both sides the encoder and the decoder.
Due to the quantization, quantization noise is superposed to the reconstructed video signal. Due to the block-wise coding, the superposed noise often has blocking characteristics, which result, in particular for strong quantization, in visible block boundaries in the decoded image. Such blocking artifacts have a negative effect upon human visual perception. In order to reduce these artifacts, a deblocking filter 150 is applied to every reconstructed image block. The deblocking filter is applied to the reconstructed signal s′. Deblocking filter generally smoothes the block edges leading to an improved subjective quality of the decoded images. Moreover, since the filtered part of an image is used for the motion compensated prediction of further images, the filtering also reduces the prediction errors, and thus enables improvement of coding efficiency.
After a deblocking filter, an adaptive loop filter 160 may be applied to the image including the already deblocked signal s″ for improving the pixel wise fidelity (“objective” quality). The adaptive loop filter (ALF) is used to compensate image distortion caused by compression. Typically, the adaptive loop filter is a Wiener Filter, as shown in FIG. 1, with filter coefficiency determined such that the mean square error (MSE) between the reconstructed s′, and source images s is minimized. The coefficients of ALF may be calculated and transmitted on a frame basis. ALF can be applied to the entire frame (image of the video sequence) or the local areas (blocks). An additional side information indicating which areas are to be filtered may be transmitted (block-based, frame-based or quadtree-based).
In order to be decoded, inter-encoded blocks require also storing the previously encoded and subsequently decoded portions of image(s) in a reference frame buffer (not shown). An inter-encoded block is predicted 180 by employing motion compensated prediction. First, a best-matching block is found for the current block within the previously encoded and decoded video frames by a motion estimator. The best-matching block then becomes a prediction signal and the relative displacement (motion) between the current block and its best match is then signalized as motion data in the form of three-dimensional motion vectors within the side information provided together with the encoded video data. The three dimensions consist of two spatial dimensions and one temporal dimension. In order to optimize the prediction accuracy, motion vectors may be determined with a spatial sub-pixel resolution e.g. half pixel or quarter pixel resolution. A motion vector with spatial sub-pixel resolution may point to a spatial position within an already decoded frame where no real pixel value is available, i.e. a sub-pixel position. Hence, spatial interpolation of such pixel values is needed in order to perform motion compensated prediction. This may be achieved by an interpolation filter (in FIG. 1 integrated within Prediction block 180).
For both, the intra- and the inter-encoding modes, the differences e between the current input signal and the prediction signal are transformed 110 and quantized 120, resulting in the quantized coefficients. Generally, an orthogonal transformation such as a two-dimensional discrete cosine transformation (DCT) or an integer version thereof is employed since it reduces the correlation of the natural video images efficiently. After the transformation, lower frequency components are usually more important for image quality then high frequency components so that more bits can be spent for coding the low frequency components than the high frequency components. In the entropy coder, the two-dimensional matrix of quantized coefficients is converted into a one-dimensional array. Typically, this conversion is performed by a so-called zig-zag scanning, which starts with the DC-coefficient in the upper left corner of the two-dimensional array and scans the two-dimensional array in a predetermined sequence ending with an AC coefficient in the lower right corner. As the energy is typically concentrated in the left upper part of the two-dimensional matrix of coefficients, corresponding to the lower frequencies, the zig-zag scanning results in an array where usually the last values are zero. This allows for efficient encoding using run-length codes as a part of/before the actual entropy coding.
FIG. 2 illustrates a state of the art decoder 200 according to the H.264/MPEG-4 AVC or HEVC video coding standard. The encoded video signal (input signal to the decoder) first passes to entropy decoder 990, which decodes the quantized coefficients, the information elements necessary for decoding such as motion data, mode of prediction etc. The quantized coefficients are inversely scanned in order to obtain a two-dimensional matrix, which is then fed to inverse quantization and inverse transformation 230. After inverse quantization and inverse transformation 230, a decoded (quantized) prediction error signal e′ is obtained, which corresponds to the differences obtained by subtracting the prediction signal from the signal input to the encoder in the case no quantization noise is introduced and no error occurred.
The prediction signal is obtained from either a temporal or a spatial prediction 280. The decoded information elements usually further include the information necessary for the prediction such as prediction type in the case of intra-prediction and motion data in the case of motion compensated prediction. The quantized prediction error signal in the spatial domain is then added with an adder 240 to the prediction signal obtained either from the motion compensated prediction or intra-frame prediction 280. The reconstructed image s′ may be passed through a deblocking filter 250, sample adaptive offset processing, and an adaptive loop filter 260 and the resulting decoded signal is stored in the memory 270 to be applied for temporal or spatial prediction of the following blocks/images
When compressing and decompressing an image, the blocking artifacts are typically the most annoying artifacts for the user. The deblocking filtering helps to improve the perceptual experience of the user by smoothing the edges between the blocks in the reconstructed image. One of the difficulties in deblocking filtering is to correctly decide between an edge caused by blocking due to the application of a quantizer and between edges which are part of the coded signal. Application of the deblocking filter is only desirable if the edge on the block boundary is due to compression artifacts. In other cases, by applying the deblocking filter, the reconstructed signal may be despaired, distorted. Another difficulty is the selection of an appropriate filter for deblocking filtering. Typically, the decision is made between several low pass filters with different frequency responses resulting in strong or weak low pass filtering. In order to decide whether deblocking filtering is to be applied and to select an appropriate filter, image data in the proximity of the boundary of two blocks are considered.
To summarize, state of the art hybrid video coders, see e.g. FIG. 1, apply block-wise prediction and block-wise prediction error coding. The prediction error coding includes a quantization step. Due to this block-wise processing, so called blocking artifacts occur, especially in the case of coarse quantization. A blocking artifact is associated with a large signal change at a block edge. These blocking artifacts are very annoying for the viewer. In order to reduce these blocking artifacts, deblocking filtering is applied, e.g. in the H.264/MPEG-4 AVC video coding standard or in the HM, which is the test model of the HEVC video coding standardization activity. Deblocking filters decide for each sample at a block boundary if it is filtered or not and apply a low pass filter in the case it is decided to filter. The aim of this decision is to filter only those samples, for which the large signal change at the block boundary results from the quantization applied in the block-wise processing. The result of this filtering is a smoothed signal at the block boundary. The smoothed signal suppresses or reduces the blocking artifacts. Those samples, for which the large signal change at the block boundary belongs to the original signal to be coded, should not be filtered in order to keep high frequencies and thus the visual sharpness. In the case of wrong decisions, the image is either unnecessarily smoothened or remains blocky.
According to the above, it is desirable to reliably judge whether a deblocking filtering needs to be applied at a block boundary between adjacent image blocks or not. The H.264/MPEG-4 AVC standard provides decision operations for the deblocking filtering on a block basis for the pixels close to the boundary in each individual pixel line, i.e., pixel row or pixel column respectively, at a block boundary. In general, the block size of the image blocks for which deblocking filtering processing is conducted in the H.264/MPEG-4 AVC standard is an 8 by 8 pixel block. It is noted, that for other purposes the smallest block size may be different, as, for example, prediction is supporting 4 by 4 blocks.
FIG. 3 illustrates the decisions for horizontal filtering of a vertical boundary/edge for each individual pixel line according to H.264/MPEG-4 AVC. FIG. 3 depicts four 8 by 8 pixel image blocks, the previously processed blocks 310, 320, 340 and the current block 330. At the vertical boundary between previously processed block 340 and current block 330 it is decided, whether deblocking filtering is applied or not. The pixel values of the pixel lines running perpendicular to the vertical boundary serve as a basis for decision for each individual pixel line. In particular, the pixel values in the marked area of each pixel line, as for instance the marked area 350 of the 5th pixel line, are the basis for the filtering decision.
Similarly, as shown in FIG. 4, decisions for vertical filtering of a horizontal boundary/edge are performed for each individual column of pixels. For instance, for the fifth column of the current block 430, the decision on whether to filter or not, the pixels of this column close to the boundary to the previously processed block 420 is performed based on the pixels marked by a dashed rectangle 450.
The decision process for each sample of either each individual pixel column or each individual pixel line, at the boundary is performed by utilizing pixel values of the adjacent blocks as shown in FIG. 5. In FIG. 5, block p represents the previously processed block 340 or 440 as shown in FIG. 3 or FIG. 4 with the pixel values p0, p1 and p2 of one line (row or column). Block q represents the current block 330 or 430, as in FIG. 3 or FIG. 4, with the pixel values q0, q1 and q2 in the same line. Pixel q0 is the pixel in the line closest to the boundary with the block q. Pixel q1 is the pixel in the same line, second closest to the boundary with the block q, etc. In particular, the pixels values p0 and q0 of the pixel line are filtered, if the following conditions are satisfied:|p0−q0|<α(QP+OffsetA),|p1−p0|<β(QP+OffsetB), and|q1−q0|<β(QP+OffsetB),wherein, QP is a quantization parameter, OffsetA and OffsettB are slice level offsets, and β is chosen to be smaller than α. Further, pixel p1 of the line is filtered, if additionally|p2−p0|<β(QP+OffsetB).
Further, the pixel of a pixel line or pixel column corresponding to the pixel value q1 is filtered if additionally|q2−q0|<β(QP+OffsetB).
According to H.264/MPEG-4 AVC, for each individual pixel line (row or column for the respective horizontal and vertical deblocking filtering), decision operations as above are performed. The filtering can be switched on/off for each individual pixel line which is associated with a high accuracy for the deblocking decision. However, this approach is also associated with a high computational expense.
A decision process for application of a deblocking filtering with a lower computational expense as for the above mentioned H.264/MPG-4 AVC standard, is suggested in “High Efficiency Video Coding (HEVC) text specification Working Draft 1” (HM deblocking filter, JCTVC-C403), freely available under http://wftp3.itu.int/av-arch/jctvc-site/2010_10_C_Guangzhou/, which is incorporated herein by reference. Here, one deblocking filtering on/off decision is applied for the entire block boundary between two adjacent image blocks based only on information of pixel lines in the block. Also here the block size of the image blocks for which deblocking filtering processing is conducted is an 8 by 8 pixel.
The decision for horizontal filtering of a vertical edge/boundary according to JCTVC-C403 is described in the following by referring to FIGS. 6, 8 and 9. FIG. 6 depicts four 8 by 8 pixel blocks, the previously processed blocks 610, 620, 640 and the current block 630. The vertical boundary between the previous block 640 and the current block 630 is the boundary for which it is decided, whether deblocking filtering is to be applied or not. The vertical boundary extends over a boundary segment corresponding to 8 lines (rows) 660. The 3rd and the 6th pixel line, which are oriented perpendicular to the vertical boundary, serve as a basis for a deblocking filtering decision. In particular, the pixel values in the marked area 650 of the 3rd and the 6th pixel line are used as a basis for the filtering decision. Hence, the filtering decision of the entire boundary corresponding to the segment of 8 lines 660, will be based on only a subset of two out of 8 pixel lines of the block.
Similarly, referring to FIG. 7, the decision for vertical filtering of a horizontal edge/boundary according to JCTVC-C403 is based on the pixel values of only two pixel columns 760 out of the segment of 8 columns 750, which constitutes the horizontal boundary.
FIG. 8 shows a matrix of pixel values, which corresponds to parts of the previous block 640 and the current block 630 of FIG. 6. The pixel values in the matrix are pi,j and qi,j, with i being an index varying perpendicular to the boundary between the blocks and with j being an index varying along to the boundary between the blocks. Index i in FIG. 8 varies only in the range from 0 to 3, corresponding to the pixel positions within a line to be filtered, which are employed for the decision and/or filtering. The remaining pixel positions of the previous and the current block are not shown. Index j in FIG. 8 varies in the range from 0 to 7, corresponding to the 8 pixel rows in the block, the vertical boundary of which is to be filtered. The two pixel lines 820 with indexes j=2 and j=5, which correspond to the respective 3rd and the 6th pixel lines, are used as a basis for the filtering decision (on/off decision) for the entire block boundary and are marked with dashed lines. In order to decide whether the segment of 8 pixel lines, which correspond to the entire boundary, is filtered, the following condition is evaluated:|p22−2·12+p02|+|q22−2·q12+q02|+|p25−2·p15+p05|+|q25−2·q15+q05|<β,wherein β is a threshold value. If the above condition is true, it is decided that the filtering is to be applied to all 8 lines of the boundary.
This decision process is further depicted in FIG. 9. When the upper equation is separated into a term d1,v, containing only pixel values of the pixel line with index j=2 and a term d2,v, containing only pixel values of the line with index j=5, the decision for filtering can be rewritten as:d1,v+d2,v<β,whereind1,v=|p22−2·p12+p02|+|q22−2·q12+q02|andd2,v=|p25−2·p15+p05|+|q25−2·q15+q05|.
Hence, by use of the two values d1,v and d2,v, it is decided by the threshold operation whether the entire vertical boundary is to be filtered or not. The index v is used herein to indicate that a decision for a vertical boundary is assessed.
FIG. 8 shows a matrix of pixel values forming boundary portions of two neighbouring blocks A and B. It is noted that this boundary may also be a horizontal boundary, so that the block A is a previously processed block and block B is the current block, block A being the top neighbour of block B. This arrangement corresponds to parts of the previous block 720 and the current block 730 in FIG. 7. The pixel values in the matrix are pi,j and qi,j, with i being an index varying perpendicular to the boundary between the blocks, the index i ranging from 0 to 3 in this example corresponding to only the part of the block A and B shown, and with the index j varying along the boundary between the blocks A and B, ranging from 0 to 7 corresponding to the number of lines (in third case columns) to be processed by deblocking filtering. In this context, “processing” or “deblocking processing” includes deciding whether deblocking filtering is to be applied or not and/or selection of the filter type. The type of filter here refers to a weak, strong or no filter for filtering pixels around the boundary in a particular line of the block. The derivation process of boundary filtering strength is described, for instance, in section 8.1.6 of the above mentioned “High Efficiency Video Coding (HEVC) text specification Working Draft 1”. In particular, when it is decided that the block is to be filtered, an individual decision is performed for each line for deciding whether a strong filter or a weak filter is to be applied. If it is decided that a weak filter is to be applied, it is tested whether it is to be applied to the line at all. A strong filter in this sense is applied to more pixels around the boundary in the pixel line than the weak filter. In general, a strong filter is a filter with a narrower pass-band than the weak filter.
The two pixel columns 820 with indexes j=2 and j=5, which correspond to the 3rd and the 6th pixel column, are used as a basis for the filtering decision and are marked with dashed lines. The horizontal boundary is filtered if|p22−2·p12+p02|+|q22−2·q12+q02|+|p25−2·p15+p05|+|q25−2·q15+q05|<β,wherein β is again a threshold value. If the above decision is true, filtering is applied to all 8 columns of the horizontal boundary, which corresponds to entire boundary. This decision process is further depicted in FIG. 10. When the upper equation is separated into a term d1,h containing only pixel values of the pixel column with index j=2 and a term d2,h, containing only pixel values of the pixel column with index j=5, the decision for filtering can be rewritten as:d1,h+d2,h<β,whereind1,h=|p22−2·p12+p02|+|q22−2·q12+q02|andd2,h=|p25−2·p15+p05|+|q25−2·q15+q05|.
Hence, by the use of the two values d1,h and d2,h, it is decided by the threshold operation if the entire horizontal boundary is filtered or not. The index h is hereby used to indicate that a decision for a horizontal boundary is assessed.
To summarize, according to JVCT-D403, the filtering can be switched on/off for the entire boundary based on only two pixel lines or pixel columns perpendicular to that boundary. For only two positions of each segment of 8 lines/columns, a decision process is performed. The filtering can be switched on/off for each segment of 8 lines/columns, corresponding to the entire block. This is associated with a lower computational expense but also with a lower accuracy of the decisions.
In contribution JCTVC-D263, “Parallel deblocking Filter”, Daegu, January 2011, freely available at http://wftp3.itu.int/av-arch/jctvc-site/2011_01_D_Daegu/which is incorporated herein by reference, the decision operations for deblocking filtering of a block are performed similarly to JCTVC-C403: One deblocking filtering on/off decision is applied for the entire block boundary based only on pixel values of two pixel rows, or pixel columns respectively, of the two vertically or horizontally adjacent image blocks. However, the difference between the two approaches is that the pixel rows, or pixel columns respectively, which are used as a basis for the decision whether the boundary is filtered or not, have a different position in the block.
The decision for horizontal filtering of a vertical boundary/edge according to JCTVC-D263 is briefly described in the following by referring to FIGS. 11 and 13. In FIG. 11, the pixel lines used as a basis for deciding on whether to filter or not, are the 4th and 5th lines 1160 at the boundary between the previous 1140 and the current block 1130. The entire vertical boundary corresponds to a segment of 8 lines 1150.
FIG. 13 shows a matrix of pixel values forming parts of the blocks A and B around a common boundary. The blocks A and B correspond to the previous block 1140 and the current block 1130 of FIG. 11, respectively. The pixel values in the matrix are pi,j and qi,j, with i being an index varying perpendicular to the boundary between the blocks and ranging from 0 to 3, and with j being an index varying along to the boundary between the blocks and ranging from 0 to 7. The two pixel lines 1320 with indexes j=3 and j=4, which correspond to the 4th and the 5th pixel line, are used as a basis for the filtering decision(s) and are marked with dashed lines. The following condition is evaluated in order to judge whether to filter or not the pixels close to the boundary in the current block:|p23−2·p13+p03|+|q23−2·q13+q03|+|p24−2·p14+p04|+|q24−2·q14+q04|<β,wherein β is a threshold value. If the above decision is true, filtering and/or further decision is performed for all lines of the boundary which corresponds to a segment comprising 8 lines. When the upper equation is separated into a term d1,v, containing only pixel values of the pixel line with index j=3 and a term d2,v, containing only pixel values of the line with index j=4, the decision for filtering can be rewritten as:d1,v+d2,v<β,whereind1,v=|p23−2·p13+p03|+|q23−2·q13+q03|andd2,v=|p24−2·p14+p04|+|q24−2·q14+q04|.
Hence, by the use of the two values d1,v and d2,v, it is decided by the threshold operation if all 8 lines of the corresponding segment are filtered or not. The index v is hereby used to indicate that a decision for a vertical boundary is assessed.
Similarly, as shown in FIG. 12, the decision for vertical filtering of a horizontal edge/boundary between a current block 1230 and a previous block 1220 according to JCTVC-D263 is based on the pixel values of only two columns 1260 out of the segment 1250 of pixels from 8 columns which constitutes the horizontal boundary between the blocks 1230 and 1220.
FIG. 13 may be also seen as corresponding to parts of the previous block 1220 and the current block 1230 of FIG. 12. The pixel values in the matrix are pi,j and qi,j, with i being an index varying perpendicular to the boundary between the blocks, ranging from 0 to 3 and with j being an index varying along to the boundary between the blocks, ranging from 0 to 7. The two pixel columns 1320 with indexes j=3 and j=4, which in this example correspond to the 4th and the 5th pixel column, are used as a basis for the filtering decision and are marked with dashed lines. Accordingly, the horizontal boundary is filtered when|p23−2·p13+p03|+|q23−2·q13+q03|+|p24−2·p14+p04|+|q24−2·q14+q04|<β,wherein β is a threshold value. If the above condition is true, filtering is applied to all columns of the boundary corresponding to one segment which is composed of 8 columns. When the upper equation is separated into a term d1,h, containing only pixel values of the column with index j=3 and a term d2,h, containing only pixel values of the column with index j=4, the decision for filtering can be rewritten as:d1,h+d2,h<β,whereind1,h=|p23−2·p13+p03|+|q23−2·q13+q03|andd2,h=|p24−2·p14+p04|+|q24−2·q14+q04|.
Hence, by using the two values d1,h and d2,h, it is decided by the threshold operation whether all 8 columns of the segment 1010 are filtered or not. The index h is hereby used to indicate that a decision for a horizontal boundary is assessed.
To summarize, similarly to the JVCT-C403, according to JVCT-D263, the filtering can be switched on/off for the entire boundary segment based on only two pixel lines or pixel columns from this segment. For only two positions of each segment of 8 lines (rows or columns), a decision process is performed. Thus, the filtering can be switched on/off for each segment of 8 lines/columns. This is associated with a low computational expense but also with a low accuracy of the decisions. An advantage of JCTVC-D263 over JCTVC-C403 is that the use of other samples allows a higher degree of a parallel processing. However, both approaches JCTVC-C403 and JCTVC-D263 provide a lower accuracy of decisions in comparison with, for example, H.264/MPEG-4 AVC.
In H.264/MPEG-4 AVC, the decisions are performed as shown in FIG. 2 to FIG. 5. At each pixel position at a block boundary, individual values are calculated using samples adjacent to the block boundary. Based on these individual values, individual decision operations are performed at each position of (for each line perpendicular to) the block boundary. This is associated with a high computational expense while providing a high accuracy of the decisions. In JCTVC-C403, pixels at the block edges form segments of 8 lines/columns (corresponding to the smallest block size used for the deblocking filtering) as shown in FIG. 6 and FIG. 7. For each segment of 8 lines/columns, values are calculated only for a subset of positions, in the examples above for only two positions rather than for all 8 positions. Based on these values, one single decision is performed whether to filter all 8 lines/columns of the segment or not. Compared to H.264/MPEG-4 AVC the computational expense is reduced since less values are calculated. The term value refers to the measure based on values of the pixels in a line close to the boundary such as d1,v and d2,v or d1,h, or d2,h as shown above. In addition, the memory bandwidth is reduced since for the calculation of values, less samples need to be accessed from the memory. However, also the accuracy of the decisions is reduced compared to the accuracy of the decisions in H.264/MPEG-4 AVC. In JCTVC-D263, the calculation of values and the decision operations are performed similar to the JCTVC-C403. The difference is that samples at other positions of the segments of 8 lines/columns are used to calculate the values. The use of these other samples allows a higher degree a parallel processing. Compared to JCTVC-C403, the computational expense as well as the memory bandwidth is the same. However, the accuracy of the decisions is further reduced. Details are explained in FIG. 11 to FIG. 13. Thus, the known approaches are either associated with a high computational expense and high memory bandwidth or with a low accuracy of the decisions. A low accuracy of the decisions, on the other hand, may result to a low coding efficiency. High computational expense and high memory bandwidth may both lead to high implementation costs.